<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: src/FileUtil.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">FileUtil.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_file_util_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This file is part of libemb.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libemb is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * libemb is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with libemb.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Project: Embedme</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Author : FergusZeng</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * Email  : cblock@126.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * git    : https://gitee.com/newgolo/embedme.git</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * Copyright 2014~2020 @ ShenZhen ,China</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __FILE_UTIL_H__</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __FILE_UTIL_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_base_type_8h.html">BaseType.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_i_o_device_8h.html">IODevice.h</a>&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">namespace </span>libemb{</div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classlibemb_1_1_file.html">   37</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_file.html">File</a>:<span class="keyword">public</span> <a class="code" href="classlibemb_1_1_i_o_device.html">IODevice</a>{</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_file.html">File</a>)</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <a class="code" href="classlibemb_1_1_file.html">File</a>();</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classlibemb_1_1_file.html">File</a>();</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#af8490db474f02342d555f1cbd9e372bd">exists</a>(<span class="keyword">const</span> std::string&amp; fileName);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#af7123e19d329a0089225188ef50587cf">getSize</a>(<span class="keyword">const</span> std::string&amp; fileName);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a245b1a78947afee45c39741a291519b1">removeFile</a>(<span class="keyword">const</span> std::string&amp; fileName);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#ac00f9fc96d3c4183be9bbfd65f6a3c6a">renameFile</a>(<span class="keyword">const</span> std::string&amp; oldFile, <span class="keyword">const</span> std::string&amp; newFile);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    </div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a1d4b5f9a06ca72df660cb68fa73863b7">isOpen</a>();</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a9771cd41ba96ec1f80f66b8978a22c50">open</a>(<span class="keyword">const</span> std::string&amp; fileName,<span class="keywordtype">int</span> ioMode) <span class="keyword">override</span>; </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a4f247c046f864633a94d223dc749cdc1">close</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#a1e78f16a86200306a281cfb70bccb737">readData</a>(<span class="keywordtype">char</span>* buf, <span class="keywordtype">int</span> len) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#ada78faccf08c9835b8043909246eefd2">writeData</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>*buf, <span class="keywordtype">int</span> len) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordtype">void</span>* <a class="code" href="classlibemb_1_1_file.html#ae444196ae3bf95c403c039e97935f7ae">mapMemory</a>();</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a6a97e74313c5d2ac43865ed8e1a8f0be">unmapMemory</a>();</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#a3091e085800e4f547f78ceef93b7c356">readLine</a>(std::string&amp; lineStr);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#af7123e19d329a0089225188ef50587cf">getSize</a>();</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    std::string <a class="code" href="classlibemb_1_1_file.html#a319d3f945b457eebdc5c2598a0927f9f">getName</a>();   </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file.html#a2293dfa48cfa9e46ed9b8a461803c8b4">isEnd</a>();</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#acf216973cef1b72f9c9db94d6d1d7dfe">getPos</a>();</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_file.html#ae1db1db7933ba28a07468118c1d0c1e7">setPos</a>(<span class="keywordtype">int</span> pos);</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    FILE* m_fp{NULL};</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    std::string m_name{<span class="stringliteral">&quot;&quot;</span>};</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    <span class="keywordtype">void</span>* m_mmaddr{NULL};</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;};</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="classlibemb_1_1_file_path.html">  161</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_file_path.html">FilePath</a>{</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_file_path.html">FilePath</a>)</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <a class="code" href="classlibemb_1_1_file_path.html">FilePath</a>(<span class="keyword">const</span> std::string&amp; filePath);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    ~<a class="code" href="classlibemb_1_1_file_path.html">FilePath</a>();</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    std::string <a class="code" href="classlibemb_1_1_file_path.html#ae1ac03f38195e19be046cfe5d5a7dd75">dirName</a>();</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    std::string <a class="code" href="classlibemb_1_1_file_path.html#ab7eebc5acf9f4453b2345f40ebb6f02f">baseName</a>();</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    std::string <a class="code" href="classlibemb_1_1_file_path.html#a27141b9fa9467bbed768aeedc1b77e0c">suffix</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_file_path.html#aeefbff749446731cba602bdb33b33308">createLink</a>(<span class="keyword">const</span> std::string&amp; filePath,<span class="keyword">const</span> std::string&amp; linkPath,<span class="keywordtype">bool</span> hard=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    std::string m_filePath{<span class="stringliteral">&quot;&quot;</span>};</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;};</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="classlibemb_1_1_directory.html">  200</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_directory.html">Directory</a>{</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_directory.html">Directory</a>)</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;    <a class="code" href="classlibemb_1_1_directory.html">Directory</a>();</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    ~<a class="code" href="classlibemb_1_1_directory.html">Directory</a>();</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_directory.html#adfbe7b0c9641cd9f4aaac0b6b9118594">isEmpty</a>(<span class="keyword">const</span> std::string&amp; dirName);</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_directory.html#a70d9a96e17b03e8468aef71dddd9dbeb">exists</a>(<span class="keyword">const</span> std::string&amp; dirName);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_directory.html#ad72f9332a445c9bb145ca36a96f11c46">getSize</a>(<span class="keyword">const</span> std::string&amp; dirName);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_directory.html#a964eb27c98070822509f01370ab12e22">createDir</a>(<span class="keyword">const</span> std::string&amp; dirName,<span class="keywordtype">bool</span> recursive=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_directory.html#a75d5d948f45d6e0e6e1e81506d61e143">removeDir</a>(<span class="keyword">const</span> std::string&amp; dirName,<span class="keywordtype">bool</span> recursive=<span class="keyword">false</span>);</div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classlibemb_1_1_directory.html#ab3376469786772477171d2b5c7800172">  247</a></span>&#160;    <span class="keyword">static</span> std::vector&lt;std::string&gt; <a class="code" href="classlibemb_1_1_directory.html#ab3376469786772477171d2b5c7800172">getFileList</a>(<span class="keyword">const</span> std::string&amp; dirName, <span class="keyword">const</span> std::string&amp; regexp);</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_directory.html#a03d242faec4eac3a51dab3988ce4f03f">enterDir</a>(<span class="keyword">const</span> std::string&amp; dirName);</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    std::string <a class="code" href="classlibemb_1_1_directory.html#a54d077f53178ad60f2bb5baeaf15b679">currentDir</a>();</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    std::vector&lt;std::string&gt; <a class="code" href="classlibemb_1_1_directory.html#ad00e0ce33e8ffbcfb6a6300ae140eb7c">getFileList</a>();</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    std::string m_currentDir{<span class="stringliteral">&quot;.&quot;</span>};</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;};</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160; </div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;}</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasslibemb_1_1_i_o_device_html"><div class="ttname"><a href="classlibemb_1_1_i_o_device.html">libemb::IODevice</a></div><div class="ttdoc">IO设备抽象类</div><div class="ttdef"><b>Definition:</b> IODevice.h:53</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_ad00e0ce33e8ffbcfb6a6300ae140eb7c"><div class="ttname"><a href="classlibemb_1_1_directory.html#ad00e0ce33e8ffbcfb6a6300ae140eb7c">libemb::Directory::getFileList</a></div><div class="ttdeci">std::vector&lt; std::string &gt; getFileList()</div><div class="ttdoc">列出当前目录下的所有文件(包含目录)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:706</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a9771cd41ba96ec1f80f66b8978a22c50"><div class="ttname"><a href="classlibemb_1_1_file.html#a9771cd41ba96ec1f80f66b8978a22c50">libemb::File::open</a></div><div class="ttdeci">bool open(const std::string &amp;fileName, int ioMode) override</div><div class="ttdoc">打开文件(继承自IODevice)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:128</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_acf216973cef1b72f9c9db94d6d1d7dfe"><div class="ttname"><a href="classlibemb_1_1_file.html#acf216973cef1b72f9c9db94d6d1d7dfe">libemb::File::getPos</a></div><div class="ttdeci">int getPos()</div><div class="ttdoc">获取当前读写位置</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:334</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a1d4b5f9a06ca72df660cb68fa73863b7"><div class="ttname"><a href="classlibemb_1_1_file.html#a1d4b5f9a06ca72df660cb68fa73863b7">libemb::File::isOpen</a></div><div class="ttdeci">bool isOpen()</div><div class="ttdoc">判断文件是否打开</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:119</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_path_html_ae1ac03f38195e19be046cfe5d5a7dd75"><div class="ttname"><a href="classlibemb_1_1_file_path.html#ae1ac03f38195e19be046cfe5d5a7dd75">libemb::FilePath::dirName</a></div><div class="ttdeci">std::string dirName()</div><div class="ttdoc">获取文件路径中的文件夹部分</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:378</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html"><div class="ttname"><a href="classlibemb_1_1_file.html">libemb::File</a></div><div class="ttdoc">文件类</div><div class="ttdef"><b>Definition:</b> FileUtil.h:37</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_path_html_aeefbff749446731cba602bdb33b33308"><div class="ttname"><a href="classlibemb_1_1_file_path.html#aeefbff749446731cba602bdb33b33308">libemb::FilePath::createLink</a></div><div class="ttdeci">static bool createLink(const std::string &amp;filePath, const std::string &amp;linkPath, bool hard=false)</div><div class="ttdoc">创建文件链接</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:415</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_path_html_ab7eebc5acf9f4453b2345f40ebb6f02f"><div class="ttname"><a href="classlibemb_1_1_file_path.html#ab7eebc5acf9f4453b2345f40ebb6f02f">libemb::FilePath::baseName</a></div><div class="ttdeci">std::string baseName()</div><div class="ttdoc">获取文件路径中的文件名部分</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:394</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a245b1a78947afee45c39741a291519b1"><div class="ttname"><a href="classlibemb_1_1_file.html#a245b1a78947afee45c39741a291519b1">libemb::File::removeFile</a></div><div class="ttdeci">static bool removeFile(const std::string &amp;fileName)</div><div class="ttdoc">删除文件</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:90</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_adfbe7b0c9641cd9f4aaac0b6b9118594"><div class="ttname"><a href="classlibemb_1_1_directory.html#adfbe7b0c9641cd9f4aaac0b6b9118594">libemb::Directory::isEmpty</a></div><div class="ttdeci">static bool isEmpty(const std::string &amp;dirName)</div><div class="ttdoc">判断目录是否为空</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:448</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_ac00f9fc96d3c4183be9bbfd65f6a3c6a"><div class="ttname"><a href="classlibemb_1_1_file.html#ac00f9fc96d3c4183be9bbfd65f6a3c6a">libemb::File::renameFile</a></div><div class="ttdeci">static bool renameFile(const std::string &amp;oldFile, const std::string &amp;newFile)</div><div class="ttdoc">重命名文件</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:99</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_af7123e19d329a0089225188ef50587cf"><div class="ttname"><a href="classlibemb_1_1_file.html#af7123e19d329a0089225188ef50587cf">libemb::File::getSize</a></div><div class="ttdeci">int getSize()</div><div class="ttdoc">获取文件大小</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:297</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_a70d9a96e17b03e8468aef71dddd9dbeb"><div class="ttname"><a href="classlibemb_1_1_directory.html#a70d9a96e17b03e8468aef71dddd9dbeb">libemb::Directory::exists</a></div><div class="ttdeci">static bool exists(const std::string &amp;dirName)</div><div class="ttdoc">判断目录是否存在</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:479</div></div>
<div class="ttc" id="a_i_o_device_8h_html"><div class="ttname"><a href="_i_o_device_8h.html">IODevice.h</a></div><div class="ttdoc">输入输出设备</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_path_html"><div class="ttname"><a href="classlibemb_1_1_file_path.html">libemb::FilePath</a></div><div class="ttdoc">文件路径</div><div class="ttdef"><b>Definition:</b> FileUtil.h:161</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_ae1db1db7933ba28a07468118c1d0c1e7"><div class="ttname"><a href="classlibemb_1_1_file.html#ae1db1db7933ba28a07468118c1d0c1e7">libemb::File::setPos</a></div><div class="ttdeci">int setPos(int pos)</div><div class="ttdoc">设置当前读写位置</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:353</div></div>
<div class="ttc" id="a_base_type_8h_html"><div class="ttname"><a href="_base_type_8h.html">BaseType.h</a></div><div class="ttdoc">基础类型头文件</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a1e78f16a86200306a281cfb70bccb737"><div class="ttname"><a href="classlibemb_1_1_file.html#a1e78f16a86200306a281cfb70bccb737">libemb::File::readData</a></div><div class="ttdeci">int readData(char *buf, int len) override</div><div class="ttdoc">读取文件(继承自IODevice)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:191</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_path_html_a27141b9fa9467bbed768aeedc1b77e0c"><div class="ttname"><a href="classlibemb_1_1_file_path.html#a27141b9fa9467bbed768aeedc1b77e0c">libemb::FilePath::suffix</a></div><div class="ttdeci">std::string suffix()</div><div class="ttdoc">获取文件名后缀</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:410</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a3091e085800e4f547f78ceef93b7c356"><div class="ttname"><a href="classlibemb_1_1_file.html#a3091e085800e4f547f78ceef93b7c356">libemb::File::readLine</a></div><div class="ttdeci">int readLine(std::string &amp;lineStr)</div><div class="ttdoc">读取一行</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:252</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_a75d5d948f45d6e0e6e1e81506d61e143"><div class="ttname"><a href="classlibemb_1_1_directory.html#a75d5d948f45d6e0e6e1e81506d61e143">libemb::Directory::removeDir</a></div><div class="ttdeci">static bool removeDir(const std::string &amp;dirName, bool recursive=false)</div><div class="ttdoc">删除目录</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:588</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_ab3376469786772477171d2b5c7800172"><div class="ttname"><a href="classlibemb_1_1_directory.html#ab3376469786772477171d2b5c7800172">libemb::Directory::getFileList</a></div><div class="ttdeci">static std::vector&lt; std::string &gt; getFileList(const std::string &amp;dirName, const std::string &amp;regexp)</div><div class="ttdoc">获取目录下的文件列表(包含目录)</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_a03d242faec4eac3a51dab3988ce4f03f"><div class="ttname"><a href="classlibemb_1_1_directory.html#a03d242faec4eac3a51dab3988ce4f03f">libemb::Directory::enterDir</a></div><div class="ttdeci">bool enterDir(const std::string &amp;dirName)</div><div class="ttdoc">进入目录</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:670</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a6a97e74313c5d2ac43865ed8e1a8f0be"><div class="ttname"><a href="classlibemb_1_1_file.html#a6a97e74313c5d2ac43865ed8e1a8f0be">libemb::File::unmapMemory</a></div><div class="ttdeci">bool unmapMemory()</div><div class="ttdoc">取消内存映射</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:238</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_a964eb27c98070822509f01370ab12e22"><div class="ttname"><a href="classlibemb_1_1_directory.html#a964eb27c98070822509f01370ab12e22">libemb::Directory::createDir</a></div><div class="ttdeci">static bool createDir(const std::string &amp;dirName, bool recursive=false)</div><div class="ttdoc">创建目录</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:551</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a2293dfa48cfa9e46ed9b8a461803c8b4"><div class="ttname"><a href="classlibemb_1_1_file.html#a2293dfa48cfa9e46ed9b8a461803c8b4">libemb::File::isEnd</a></div><div class="ttdeci">bool isEnd()</div><div class="ttdoc">是否到文件结尾</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:324</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_af8490db474f02342d555f1cbd9e372bd"><div class="ttname"><a href="classlibemb_1_1_file.html#af8490db474f02342d555f1cbd9e372bd">libemb::File::exists</a></div><div class="ttdeci">static bool exists(const std::string &amp;fileName)</div><div class="ttdoc">判断文件是否存在</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:73</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_ad72f9332a445c9bb145ca36a96f11c46"><div class="ttname"><a href="classlibemb_1_1_directory.html#ad72f9332a445c9bb145ca36a96f11c46">libemb::Directory::getSize</a></div><div class="ttdeci">static int getSize(const std::string &amp;dirName)</div><div class="ttdoc">获取目录大小(包含子目录及所有文件，包括硬链接文件)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:512</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a319d3f945b457eebdc5c2598a0927f9f"><div class="ttname"><a href="classlibemb_1_1_file.html#a319d3f945b457eebdc5c2598a0927f9f">libemb::File::getName</a></div><div class="ttdeci">std::string getName()</div><div class="ttdoc">获取文件名称</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:319</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html"><div class="ttname"><a href="classlibemb_1_1_directory.html">libemb::Directory</a></div><div class="ttdoc">目录类.</div><div class="ttdef"><b>Definition:</b> FileUtil.h:200</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_a4f247c046f864633a94d223dc749cdc1"><div class="ttname"><a href="classlibemb_1_1_file.html#a4f247c046f864633a94d223dc749cdc1">libemb::File::close</a></div><div class="ttdeci">bool close() override</div><div class="ttdoc">关闭文件(继承自IODevice)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:181</div></div>
<div class="ttc" id="a_base_type_8h_html_a57e803e49526dc5ba8c1915c68708ae0"><div class="ttname"><a href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a></div><div class="ttdeci">#define DECL_CLASSNAME(ClassName)</div><div class="ttdef"><b>Definition:</b> BaseType.h:176</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_ae444196ae3bf95c403c039e97935f7ae"><div class="ttname"><a href="classlibemb_1_1_file.html#ae444196ae3bf95c403c039e97935f7ae">libemb::File::mapMemory</a></div><div class="ttdeci">void * mapMemory()</div><div class="ttdoc">将文件映射到内存</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:224</div></div>
<div class="ttc" id="aclasslibemb_1_1_directory_html_a54d077f53178ad60f2bb5baeaf15b679"><div class="ttname"><a href="classlibemb_1_1_directory.html#a54d077f53178ad60f2bb5baeaf15b679">libemb::Directory::currentDir</a></div><div class="ttdeci">std::string currentDir()</div><div class="ttdoc">获取当前目录路径</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:701</div></div>
<div class="ttc" id="aclasslibemb_1_1_file_html_ada78faccf08c9835b8043909246eefd2"><div class="ttname"><a href="classlibemb_1_1_file.html#ada78faccf08c9835b8043909246eefd2">libemb::File::writeData</a></div><div class="ttdeci">int writeData(const char *buf, int len) override</div><div class="ttdoc">写入文件(继承自IODevice)</div><div class="ttdef"><b>Definition:</b> FileUtil.cpp:206</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
